//
//  NavRightButtonView.swift
//  xgwjinterconnection
//
//  Created by WangWeiShuo on 2025/8/29.
//

import SwiftUI

struct NavRightButtonView: View {
    let title: String
    let onRightClick: () -> Void
    
    var body: some View {
        HStack() {
            Spacer()
            Text(title)
                .font(.title3)
                .foregroundColor(.white)
                .frame(maxWidth: 300)
            Spacer()
            
            Button(action: onRightClick) {
                Image(systemName: "qrcode.viewfinder")
                    .foregroundColor(.white)
            }
        }
        .padding()
        .frame(maxWidth: .infinity)
        .background(
            Image("bg_titlebar")
                .resizable()
                .edgesIgnoringSafeArea(.top)
        )
        .edgesIgnoringSafeArea(.top)
    }
}

#Preview {
    NavRightButtonView(title: "wika", onRightClick:{})
}
